#pragma once

#include "IXMenuItem.h"
#include "XFrameImpl.h"
#include "XItemStatus.h"



class CXMenuItemImpl : public ItemDrawColorStatus<CXFrameImpl<IXMenuItem>>
{
    typedef ItemDrawColorStatus<CXFrameImpl<IXMenuItem>> superclass;
    BEGIN_DEF_SKIN_CLASS(CXMenuItemImpl, superclass, gs_strGuidXSkin)
        IMP_BASIC_INTF(IXMenuItem,  0)
    END_DEF_SKIN_CLASS();

public:
    // 
    CXMenuItemImpl();
    virtual ~CXMenuItemImpl();

public:
    // IXMenuItem
    virtual HRESULT STDMETHODCALLTYPE   put_Check(IN BOOL bCheck);
    virtual HRESULT STDMETHODCALLTYPE   get_Check(OUT BOOL* pbCheck);

    virtual HRESULT STDMETHODCALLTYPE   put_Enable(IN BOOL bEnable);
    virtual HRESULT STDMETHODCALLTYPE   get_Enable(OUT BOOL* pbEnable);

    virtual HRESULT STDMETHODCALLTYPE   put_TextColor(IN COLORREF clrText);
    virtual HRESULT STDMETHODCALLTYPE   get_TextColor(OUT COLORREF* pClrText);

    virtual IXMenuEx* STDMETHODCALLTYPE GetSubMenu();

public:
    // IXControl
    virtual void    STDMETHODCALLTYPE   GetAutoSize(OUT LPSIZE pAutoSize);
    virtual void    STDMETHODCALLTYPE   Draw(XCANVAS xCanvas, const RECT& rcDraw);

protected:
    // 
    virtual BOOL OnClicked(const POINT* pt);
    virtual BOOL STDMETHODCALLTYPE   OnMouseHover(POINT* pt);
    virtual BOOL STDMETHODCALLTYPE   OnMouseLeave(POINT* pt);

protected:
    BOOL    m_bChecked;
};
